<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ page trimDirectiveWhitespaces="true" %>
<%@include file="/admin/include/includeAdminTaglibs.jsp" %>
<!DOCTYPE html>
<html>
<head>
    <t:base type="jquery,easyui1.5"></t:base>
    <style>
        * {
            font-size: 12px;
        }
    </style>
</head>
<body>
<div class="easyui-panel" fit="true" title="被照护人信息">
<form method="post" id="formObj" name="formObj" autocomplete="off">
    <input type="hidden" name="serviceId" value="${serviceModel.serviceId}"/>
    <input type="hidden" name="createUserId" value="${serviceModel.createUserId}"/>
    <input type="hidden" name="createDate" value="<fmt:formatDate value="${serviceModel.createDate}" pattern="yyyy-MM-dd HH:mm:ss" />"/>
    <table cellpadding="5" width="100%">
       <tr>
            <td width="10%" align="right">姓名:</td>
            <td width="20%">
                <input class="easyui-textbox" type="text" name="fullName"  data-options="required:true" value="${serviceModel.fullName}"/>
            </td>
            <td width="10%" align="right">性别:</td>
            <td width="20%">
                <select  data-options="required:true,panelHeight:48" class="easyui-combobox" name="sex" style="width:40px;" editable="false"><option value="1" ${serviceModel.sex eq 1 ? 'selected' : ''}>男</option><option value="2" ${serviceModel.sex eq 2 ? 'selected' : ''}>女</option></select>
            </td>
        </tr>
        <tr>
            <td align="right">出生日期:</td>
            <td >
                <input class="easyui-datebox"  data-options="required:true"style="width:40%;" editable="false" name="birthday" value="<fmt:formatDate value="${serviceModel.birthday}" pattern="yyyy-MM-dd" /> "/>
            </td>
            <td align="right">身份证号码:</td>
            <td>
                <input class="easyui-textbox" type="text" name="idCard"  data-options="required:true" value="${serviceModel.idCard}"/>
            </td>
        </tr>
        <tr>
            <td align="right">婚姻状况:</td>
            <td>
                <select  data-options="required:true,panelHeight:90" class="easyui-combobox" name="marriage" style="width:80px;" editable="false"><option value="1" ${serviceModel.marriage eq 1 ? 'selected' : ''}>未婚</option><option value="2" ${serviceModel.marriage eq 1 ? 'selected' : ''}>已婚</option><option value="3" ${serviceModel.marriage eq 1 ? 'selected' : ''}>丧偶</option><option value="4" ${serviceModel.marriage eq 1 ? 'selected' : ''}>离婚</option></select>
            </td>
            <td align="right">语言:</td>
            <td>
                <select  data-options="required:true,panelHeight:50" class="easyui-combobox" name="language" style="width:80px;" editable="false"><option value="1" ${serviceModel.language eq 1 ? 'selected' : ''}>广州话</option><option value="2" ${serviceModel.language eq 2 ? 'selected' : ''}>普通话</option></select>
            </td>
        </tr>
        <tr>
            <td align="right">教育程度:</td>
            <td>
                <select  data-options="required:true,panelHeight:124" class="easyui-combobox" name="educationLevel" style="width:90px;" editable="false"><option value="1" ${serviceModel.educationLevel eq 1 ? 'selected' : ''}>从未入学</option><option value="2" ${serviceModel.educationLevel eq 2 ? 'selected' : ''}>小学</option><option value="3" ${serviceModel.educationLevel eq 3 ? 'selected' : ''}>初中</option><option value="4" ${serviceModel.educationLevel eq 4 ? 'selected' : ''}>高中</option><option value="5" ${serviceModel.educationLevel eq 5 ? 'selected' : ''}>大专或以上</option><option value="6" ${serviceModel.educationLevel eq 6 ? 'selected' : ''}>特殊教育</option></select>
            </td>
            <td align="right">既往职业:</td>
            <td>
                <select  data-options="required:true,panelHeight:324" class="easyui-combobox" name="previousOccupation" style="width:90px;" editable="false">
                    <option value="1" ${serviceModel.previousOccupation eq 1 ? 'selected' : ''}>教师</option>
                    <option value="2" ${serviceModel.previousOccupation eq 2 ? 'selected' : ''}>会计</option>
                    <option value="3" ${serviceModel.previousOccupation eq 3 ? 'selected' : ''}>警察</option>
                    <option value="4" ${serviceModel.previousOccupation eq 4 ? 'selected' : ''}>厨师</option>
                    <option value="5" ${serviceModel.previousOccupation eq 5 ? 'selected' : ''}>银行工作者</option>
                    <option value="6" ${serviceModel.previousOccupation eq 6 ? 'selected' : ''}>工程师</option>
                    <option value="7" ${serviceModel.previousOccupation eq 7 ? 'selected' : ''}>医生</option>
                    <option value="8" ${serviceModel.previousOccupation eq 8 ? 'selected' : ''}>军人</option>
                    <option value="9" ${serviceModel.previousOccupation eq 9 ? 'selected' : ''}>公务员</option>
                    <option value="10" ${serviceModel.previousOccupation eq 10 ? 'selected' : ''}>工人</option>
                    <option value="11" ${serviceModel.previousOccupation eq 11 ? 'selected' : ''}>商人</option>
                    <option value="12" ${serviceModel.previousOccupation eq 12 ? 'selected' : ''}>农民</option>
                    <option value="13" ${serviceModel.previousOccupation eq 13 ? 'selected' : ''}>律师</option>
                    <option value="14" ${serviceModel.previousOccupation eq 14 ? 'selected' : ''}>无职业</option>
                    <option value="15" ${serviceModel.previousOccupation eq 15 ? 'selected' : ''}>自由职业</option>
                    <option value="16" ${serviceModel.previousOccupation eq 16 ? 'selected' : ''}>其他</option>
                </select>
            </td>
        </tr>
        <tr>
            <td align="right">地址:</td>
            <td colspan="3">
                <input class="easyui-textbox" type="text" name="address"  data-options="required:true" style="width:40%" value="${serviceModel.address}"/>
            </td>
        </tr>
        <tr>
            <td align="right">居住状况:</td>
            <td>
                <select  data-options="required:true,panelHeight:110" class="easyui-combobox" name="livingConditions" style="width:110px;" editable="false">
                    <option value="1" ${serviceModel.livingConditions eq 1 ? 'selected' : ''}>独居</option>
                    <option value="2" ${serviceModel.livingConditions eq 2 ? 'selected' : ''}>与配偶同住</option>
                    <option value="3" ${serviceModel.livingConditions eq 3 ? 'selected' : ''}>与配偶及子女同住</option>
                    <option value="4" ${serviceModel.livingConditions eq 4 ? 'selected' : ''}>与子女同住</option>
                    <option value="5" ${serviceModel.livingConditions eq 5 ? 'selected' : ''}>与其他人士同住</option>
                </select>
            </td>
            <td align="right">每月收入来源:</td>
            <td>
                <select  data-options="required:true,panelHeight:150" class="easyui-combobox" name="monthIncome" style="width:140px;" editable="false">
                    <option value="1" ${serviceModel.monthIncome eq 1 ? 'selected' : ''}>个人储蓄／投资</option>
                    <option value="2" ${serviceModel.monthIncome eq 2 ? 'selected' : ''}>退休金</option>
                    <option value="3" ${serviceModel.monthIncome eq 3 ? 'selected' : ''}>家人供养（直系亲属）</option>
                    <option value="4" ${serviceModel.monthIncome eq 4 ? 'selected' : ''}>亲友资助</option>
                    <option value="5" ${serviceModel.monthIncome eq 5 ? 'selected' : ''}>五保户</option>
                    <option value="6" ${serviceModel.monthIncome eq 6 ? 'selected' : ''}>低保户</option>
                    <option value="7" ${serviceModel.monthIncome eq 7 ? 'selected' : ''}>困难户</option>
                </select>
            </td>
        </tr>
    </table>
    <table cellpadding="5" width="100%">
    </table>
</form>
    <div style="text-align:center;padding:5px 0">
        <a href="javascript:void(0)" class="easyui-linkbutton" onclick="submitForm()" style="width:80px">提交</a>
        <a href="/admin/service/list" class="easyui-linkbutton" style="width:80px">返回</a>
    </div>
</div>
<script>
    $("#formObj").form({
        url: '${frontPath}/admin/service/save',
        onSubmit: function () {
            var flag = $(this).form('validate');
            return flag;
        },
        success: function (resultObj) {
            var tip="成功"
            resultObj=$.parseJSON(resultObj)
            if(!resultObj.success){
                tip="失败"
            }
            top.showMessage("${empty serviceModel.serviceId ? '添加' : '修改'}被照护人信息"+tip)
            top.contentIFrameLoadUrl("","${frontPath}/admin/service/list")
        }
    })
    function submitForm(){
        $("#formObj").submit()
    }
</script>
</body>
</html>